<?php
class Re_messagedata_m extends CI_Model{
	function _consttuct() {
		parent::_construct();
		$this->load->database();
	}
	public  function re_msg_insert($arr){
		$this->db->insert('re_messagedata',$arr);
	}
	public function re_msg_del($id){
		$this->db->where('id',$id);
		$this->db->delete('re_messagedata');
	}
	public function re_msg_update($id,$arr){
		$this->db->where('id',$id);
		$this->db->update('re_messagedata',$arr);
	}
	public function all_re_msg_count(){
		return  $this->db->count_all('re_messagedata');
	}

	public function re_msg_count($id){
		$this->db->where('re_message_id',$id);
		return  $this->db->count_all('re_messagedata');
	}

	public function re_messagedata_selectall(){
		$sql="SELECT * FROM re_messagedata ORDER BY 'id'";
		return  $this->db->query($sql);
	}

	public function re_messagedata_SelectByID($re_message_id,$begin,$counts){
		$sql="SELECT * FROM re_messagedata WHERE re_message_id= ? ORDER BY 'id' LIMIT ?,?";
		return  $this->db->query($sql,array($re_message_id,$begin,$counts))->result();
	}

}
?>